package com.guys8.cemsbackend.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.guys8.cemsbackend.DTO.ClassInformation;
import com.guys8.cemsbackend.DTO.UserInformation;
import com.guys8.cemsbackend.entity.Account;
import com.guys8.cemsbackend.entity.ClassUser;
import com.guys8.cemsbackend.mapper.ClassMapper;
import com.guys8.cemsbackend.entity.Class;
import com.guys8.cemsbackend.service.ClassService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

/**
 * (Class)表服务实现类
 *
 * @author breeze
 * @since 2022-08-24 16:53:22
 */
@Service("classService")
public class ClassServiceImpl extends ServiceImpl<ClassMapper, Class> implements ClassService {

    public Class getbyclassname(String classname) {
        Map<String,Object> accountMap = new HashMap<>();
        accountMap.put("class_name", classname);
        List<Class> classes = this.listByMap(accountMap);
        if(classes.size()<1)
            return null;
        return classes.get(0);
    }
}

